
package com.zsrt.day20170505.homework.ch01;


import org.junit.Before;
import org.junit.Test;


public class NodeTest {

	Node head = new Node();
	NodeMethodDao dao = new NodeMethodDaoImpl(head);
	@Before
	public void Init(){
		
		Student student1 = new Student("罗智壕",22,'男');
		Student student2 = new Student("罗佳",22,'女');
		Student student3 = new Student("何小强",26,'男');
		Student student4 = new Student("靳志辉",21,'女');
		Student student5 = new Student("贾梦菊",23,'男');
		
		/*Node node1 = new Node(student1);
		Node node2 = new Node(student2);
		Node node3 = new Node(student3);
		Node node4 = new Node(student4);
		Node node5 = new Node(student5);*/
		
		
		//NodeMethodDao dao = new NodeMethodDaoImpl();
		dao.addStudent(student1);
		dao.addStudent(student2);
		dao.addStudent(student3);
		dao.addStudent(student4);
		dao.addStudent(student5);
	}
	
	@Test
	public void deleteTest() throws Exception {
		
		
		dao.printStudent();
		
		System.out.println("删除学生后的列表");
		Student student1 =new Student("罗智壕",22,'男') ;
		dao.deleteStudent(student1 );
		dao.printStudent();
		
		
	}
	@Test
	public void insertTest() throws Exception {
		System.out.println("插入学生");
		Student insertsSudent = new Student("众筹吃",33,'男');
		Student student2 = new Student("罗智壕",22,'男');
		dao.insertStudent(student2 , insertsSudent );
		dao.printStudent();
		
	}
	
	@Test
	public void updateTest() throws Exception {
		
		String studentName = "贾梦菊";
		int age = 00;
		dao.updateStudent(studentName, age );
		dao.printStudent();
	}
	
	@Test
	public void girlsTest() throws Exception {
		
		dao.printGirls();
	}
	
	
}
